import service from "@/utils/fetch";
const post = {
  //获取验证码
  authCode(params) {
    return service({
      method: "get",
      params,
      url: "/auth/code",
    });
  },

  //获取登录验证码
  loginEmailCode(params) {
    return service({
      method: "post",
      data: params,
      url: "/auth/loginEmailCode",
    });
  },

  // 登录
  login(params) {
    return service({
      method: "post",
      data: params,
      url: "/auth/login",
    });
  },

  // 获取用户信息
  authInfo(params) {
    return service({
      method: "get",
      data: params,
      url: "/auth/info",
    });
  },

  // 退出登录
  logout(params) {
    return service({
      method: "delete",
      data: params,
      url: "/auth/logout",
    });
  },

  // 商户注册
  sellerRegister(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/tenant/register",
    });
  },

  // 商户注册验证码
  registerCode(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/tenant/registerEmailCode",
    });
  },

  // 查询商户续费规则列表
  tenantRenewRule(params) {
    return service({
      method: "get",
      params,
      url: "/api/tenantRenewRule/",
    });
  },

  // 查询当前商户表详情
  tenant_current() {
    return service({
      method: "get",
      url: "/api/tenant/current",
    });
  },

  // 修改商户：商家主页设置
  tenant_center_config(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/tenant/center",
    });
  },

  // 平台配置信息
  platformConfig() {
    return service({
      method: "get",
      url: "/api/sysConfig/",
    });
  },

  // 商户配置：查询配置
  getTenantConfig() {
    return service({
      method: "get",
      url: "/api/tenantConfig/",
    });
  },

  // 商户配置：编辑配置
  updateTenantConfig(params) {
    return service({
      method: "put",
      data: params,
      url: "/api/tenantConfig/",
    });
  },

  // 忘记密码：发送邮箱验证码
  forgetPasswordEmailCode(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/users/forgetPasswordEmailCode",
    });
  },

  // 忘记密码-修改密码
  forgetPassword(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/users/forgetPassword",
    });
  },
};

export default post;
